home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / BYTEC.MIN < prev    next >
Text File  |  1991-12-30  |  4KB  |  150 lines

  1. #(Mbyte-compile,_BUFFERS.MIN)#(Mbyte-compile,_CASE.MIN)#(Mbyte-compile,_COMPILE.MIN)#(Mbyte-compile,_FILE.MIN)#(Mbyte-compile,_HELP.MIN)#(Mbyte-compile,_HISTORY.MIN)#(Mbyte-compile,_INDENT.MIN)#(Mbyte-compile,_INPUT.MIN)#(Mbyte-compile,_KBDMACR.MIN)#(Mbyte-compile,_KEYS.MIN)#(Mbyte-compile,_KILLS.MIN)#(Mbyte-compile,_MODES.MIN)#(Mbyte-compile,_MOVE.MIN)#(Mbyte-compile,_PARAS.MIN)#(Mbyte-compile,_RECTANG.MIN)#(Mbyte-compile,_REGISTE.MIN)#(Mbyte-compile,_SEARCHE.MIN)#(Mbyte-compile,_STARTUP.MIN)#(Mbyte-compile,_TRANSPO.MIN)#(Mbyte-compile,_UNCLASS.MIN)#(Mbyte-compile,_UTILS.MIN)#(Mbyte-compile,_VARIABL.MIN)#(Mbyte-compile,_WINDOWS.MIN)
  2. #(Mbyte-compile,mintednew.min)
  3.  
  4. M-x ef of byte-compil
  5.  
  6.  
  7.  
  8. Name:M:byte-compile-file
  9. Given the name of a .MIN file, compile it into .ED and .EDD files.
  10. [*]#(ds,value,##(lv,cd))
  11. #(Fread-filename,Byte-compile: ,(
  12.     #(Mbyte-compile,##(value))
  13. ))
  14. [*]
  15.  
  16. Name:Mbyte-compile-docs
  17. Switch to the documentation buffer, kill the old docs, and insert the new.
  18. Also remove the documentation from the *byte compile* buffer.
  19. [*]
  20. #(Fexcurse-buffer,(
  21.     #(ds,value,##(env.EMACS)##(##(lib-letter)filename).edd)
  22. ;; Make sure the documentation file is in a buffer.
  23.     #(Ffind-buffer,##(##(lib-letter)filename).edd,,,(
  24.         #(Ffind-unused-buffer,##(value))
  25.         #(==,##(ff,##(value)),,(        ;;if no file,
  26.             #(Fbuffer-set-fn,##(value))    ;;  just set name.
  27.         ),(
  28.             #(Fvisit-do)            ;;otherwise load file.
  29.         ))
  30.         #(Fremember-buffer,bury)        ;;put the buffer away.
  31.     ))
  32. ;;find the beginning of the section for this file.
  33.     #(lp,##(bc,13,d,a)##(bc,10,d,a)Source:##(lib-name)##(bc,13,d,a)##(bc,10,d,a))
  34.     #(pm,2)
  35.     #(l?,[,],0,,(
  36.         #(sp,0)        ;;we found it -- delete the old one.
  37.         #(l?,>,],,1,(
  38.             #(dm,1)
  39.         ))
  40.     ),(
  41.         #(sp,])        ;;not found -- append it.
  42.     ))
  43.     #(Fcrlf)
  44.     #(is,Source:##(lib-name))
  45.     #(Fcrlf)
  46.     #(bi,##(old-buffer),[)
  47.     #(Fcrlf)
  48.     #(is,Source:##(lib-name))
  49.     #(Fcrlf)
  50.     #(pm)
  51. ))
  52. #(dm,[)
  53. [*]
  54.  
  55.  
  56.  
  57. Name:Mbyte-compile
  58. Enter with arg1 set to the name of a file.
  59. Remove comments from the file.
  60. Define the strings in the file.
  61. Switch to the documentation buffer, kill the old docs, and insert the new.
  62. [*]#(ds,lib-name,arg1)
  63. #(Fremember-buffer)
  64. #(Ffind-or-make-buffer,*byte-compile*)
  65. #(Fcase,#(rf,arg1),
  66.     (File not found,(#(Ferror,arg1 not found))),
  67.     (File too large,(#(Ferror,arg1 too large))),
  68.     (#(..))
  69. )
  70. ;; remember the date on the source used to byte-compile this.
  71. #(ds,Fdate.arg1,##(ct,arg1))
  72. #(ds,Fmodified)
  73. #(pm,3)
  74. ;;
  75. ;; find and delete the comments.
  76. ;;
  77. #(sp,[)
  78. #(lp,##(bc,9,d,a)*;    ;.*##(bc,13,d,a)##(bc,10,d,a),,r)
  79. #(Fwhile-yes,(
  80.     #(l?,.,],0,1,(
  81.         #(sp,0)        ;;go to the beginning of it,
  82.         #(dm,1)        ;;and delete to the end of it.
  83.         yes
  84.     ))
  85. ))
  86. #(sp,[)
  87. #(es,lib-letter)
  88. #(Fwhile-yes,(
  89. ;; search for the next function.
  90.     #(lp,##(bc,13,d,a)##(bc,10,d,a)Name:,,r)
  91.     #(l?,.,],,0,(
  92.         #(sp,0$>>>>>>)
  93. ;;now see if they specified arguments.
  94.         #(ds,arglist,##(Farglist))
  95.         #(==,##(rm,^),Args:,(
  96.             #(sp,>)#(sm,1)#(sp,$<)
  97.             #(ds,arglist,SEL(F,)##(rm,1))
  98.         ))
  99. ;;find the beginning and end of the string.
  100.         #(lp,#(Mstrings-delimiter))
  101.         #(l?,0,],,1)
  102.         #(l?,1,],2)
  103.         #(sp,0)
  104.         #(Fisupper,##(bc,##(rm,>),a,d),(
  105. ;;now switch to defining strings in that library.  Dump the documentation
  106. ;;if it's a different library.
  107.             #(==,##(rm,>),##(lib-letter),,(
  108.                 #(==,##(lib-letter),,,(
  109.                     #(sp,^)
  110.                     #(SELF-docs)
  111.                     #(sp,0)
  112.                 ))
  113.                 #(mp,lib-list,,##(rm,>))
  114.                 #(ds,lib-list,##(lib-list)##(rm,>))
  115.                 #(ds,lib-letter,##(rm,>))
  116.             ))
  117.             #(ds,##(rm,>)modified)
  118.             #(an,arg1:##(rm,$))
  119.             #(ds,temp,##(rm,$))
  120.             #(sp,$>)
  121. ;;delete blank lines before the documentation.
  122.             #(==,##(rc,1),##(nc,#(Mstrings-delimiter)),(
  123.                 #(sp,0^)
  124.                 #(dm,1)
  125.                 #(Fwhile-yes,(
  126.                     #(==,##(rc,<),2,(
  127.                         ##(dm,<)
  128.                         yes
  129.                     ))
  130.                 ))
  131.             ))
  132. ;;define the string.
  133.             #(sp,1)
  134.             #(ds,##(temp),##(rm,2))
  135.             #(mp,##(temp),#(arglist))
  136.             #(dm,2#(Floop,>,##(nc,#(Mstrings-delimiter))))
  137. ;;check for a user break.
  138.             #(Fbreak,,yes)
  139.         ),(
  140.             #(Ferror,All string names must begin with an uppercase letter)
  141.         ))
  142.     ))
  143. ))
  144. ;;dump the last documentation.
  145. #(SELF-docs)
  146. #(pm)
  147. #(sv,mb,0)
  148. #(Fkill-buffer)
  149. [*]
  150.